<%--
  Created by IntelliJ IDEA.
  User: apple
  Date: 2022/4/16
  Time: 4:25 下午
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form>
    <input type="hidden" value="${user.id}" name="id"/>
    用户名:<input type="text" name="userName" value="${user.userName}"/>
    <br>
    密码：<input type="password" name="pwd" value="${user.pwd}"/>
    <br>
    姓名：<input type="text" name="realName" value="${user.realName}"/>
    <br>
    所属部门:
    <select name="deptId">
        <c:forEach items="${depts}" var="dept">
            <option value="${dept.id}" <c:if test="${user.deptId==dept.id}">selected</c:if>>${dept.deptName}</option>
        </c:forEach>
    </select>
    <br>
    <input type="submit" value="保存"/>
</form>
</body>
</html>
